package com.demo.flink.userBehavior

import java.util.Properties

object PropertiesUtils {
  def read(): Properties = {
    val props = new Properties()
    val is = this.getClass.getClassLoader.getResourceAsStream("kafka.properties")
    props.load(is)
    props
  }
  def get(props: Properties, propertyName: String, default: String): String = {
    val value = props.getProperty(propertyName)
    if(value!=null) value else default
  }
}
